package com.stus.web;

import com.stus.model.Users;
import com.stus.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class LoginController {
	@Autowired
	private UsersService usersService;
	@RequestMapping("/index")
	public String loginController(String username, String password) {
		Users users = usersService.LoginUser(username);
		if (username.equals(users.getUsername())&&password.equals(users.getPassword())){
			return "index";
		}else {
			return "login";
		}
	}
}